home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / KEYPAD.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  52 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef keypad
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_keypad = "$Header: c:/curses/portable/RCS/keypad.c%v 2.0 1992/11/15 03:28:58 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   keypad()     - enable keypad
  15.  
  16.   X/Open Description:
  17.        This function changes the keypad option of the user's terminal.
  18.        If enabled (bf is TRUE), the user can press a function key (such
  19.        as the left arrow key) and getch() will return a single value
  20.        that represents the KEY_LEFT function key.  (See Section 11.3.3,
  21.        Input Values.)  If disabled, curses will not treat function keys
  22.        as special keys and the program has to interpret the escape
  23.        sequences itself.  If the keypad is enabled, the terminal keypad
  24.        is turned on before input begins.
  25.  
  26.   PDCurses Description:
  27.        In the above text, substitute the following string:
  28.                "escape sequences"      ->      "scan codes"
  29.                "Section 11.3.3"        ->      "curses.h" or "intro.man"
  30.  
  31.        This routine is also provided as a macro.
  32.  
  33.   X/Open Return Value:
  34.        The keypad() function returns OK on success and ERR on error.
  35.  
  36.   X/Open Errors:
  37.        No errors are defined for this function.
  38.  
  39.   Portability:
  40.        PDCurses        int keypad( WINDOW* win, bool bf );
  41.        X/Open Dec '88  int keypad( WINDOW* win, bool bf );
  42.        BSD Curses      int keypad( WINDOW* win, bool bf );
  43.        SYS V Curses    int keypad( WINDOW* win, bool bf );
  44.  
  45. **man-end**********************************************************************/
  46.  
  47. int    keypad( WINDOW *win, bool bf )
  48. {
  49.        win->_use_keypad = bf;
  50.        return( OK );
  51. }
  52.